package com.llh.cheap.models;

import com.llh.cheap.CheapConstants;
import lombok.Data;
import top.moirae.core.ErrorMessage;
import top.moirae.security.models.Rule;
import top.moirae.security.models.User;

/**
 * C端用户表(CheapUser)表数据库访问层
 *
 * @author lilinhan
 * @since 2025-10-13 10:41:37
 */
@Data
public class CheapUser {

    public static final String ENTITY_NAME = "CHEAP_USER";

    private String id;
    private User user; // 加盟商用户id
    private String bossId; // 老板id
    private String wechatName; // 微信名称
    private String customerNumber; // 平台客服工号
    private String qxtCode; // 千讯通用户绑定code
    private String qxtShare; // 千讯通分享码url
    private String qxtAccount; // 千迅通账号
    private String qxtPassword; // 千迅通密码
    private String employeeNumber; // 员工工号
    private String recommendName; // 推荐人名称

    public static class Rules {
        public static Rule.Constant READ = new Rule.Constant(CheapConstants.MODULE, ENTITY_NAME, "READ");
        public static Rule.Constant CREATE = new Rule.Constant(CheapConstants.MODULE, ENTITY_NAME, "CREATE");
        public static Rule.Constant UPDATE = new Rule.Constant(CheapConstants.MODULE, ENTITY_NAME, "UPDATE");
        public static Rule.Constant DELETE = new Rule.Constant(CheapConstants.MODULE, ENTITY_NAME, "DELETE");
    }

    public static class Errors {
        public static final ErrorMessage NOT_FOUND = new ErrorMessage(CheapConstants.MODULE, ENTITY_NAME, "NOT_FOUND");
    }

    public Long getBossId() {
        return Long.parseLong(bossId);
    }
}

